<?php 
defined('IN_ADMIN') or exit('No permission resources.');
include $this->admin_tpl('header', 'admin');
$modelid = 100;
?>
<div class="pad-10">
<form method="post" action="?m=daoshi&c=admin_daoshi&a=<?php echo $_GET['a'];?>" name="myform" id="myform">
<table class="table_form" width="100%" cellspacing="0">
<tbody>
	<tr>
		<th width="80"><strong>导师</strong></th>
		<td>
		<?php echo select_category('category_daoshi_'.$modelid,$parentid,'name="xx[catid]" id="parentid" onchange="load_file_list(this.value)"',L('please_select_parent_category'),0,-1);?> >> <span id="show_template"></span>
		</td>
	</tr>
    <tr>
		<th width="80"><strong>值班日期</strong></th>
		<td><?php echo form::date('announce[date]', date('Y-m-d'), 1)?></td>
	</tr>
    <tr>
		<th width="80"><strong>开始时间</strong></th>
		<td><?php echo form::date('announce[starttime]', date('Y-m-d H:i:s'), 1)?></td>
	</tr>
    <tr>
		<th width="80"><strong>结束时间</strong></th>
		<td><?php echo form::date('announce[endtime]', date('Y-m-d H:i:s'), 1);?></td>
	</tr>
    <tr>
		<th width="80"><strong>值班地点</strong></th>
		<td><input name="announce[address]" id="address" class="input-text" type="text" size="50" ></td>
	</tr>
	</tbody>
</table>
<input type="submit" name="dosubmit" id="dosubmit" value=" <?php echo L('ok')?> " >&nbsp;<input type="reset"  value=" <?php echo L('clear')?> ">
</form>
</div>
</body>
</html>
<script type="text/javascript">
function load_file_list(id) {
	if (id=='') return false;
	//alert(id);
	$.getJSON('?m=daoshi&c=admin_daoshi&a=selectdaoshi&catid='+id+'&pc_hash='+pc_hash, function(data){
		$('#show_template').html(data.show_template);
		
		});
}

$(document).ready(function(){
	$.formValidator.initConfig({formid:"myform",autotip:true,onerror:function(msg,obj){window.top.art.dialog({content:msg,lock:true,width:'220',height:'70'}, function(){this.close();$(obj).focus();})}});
	$("#content").formValidator({autotip:true,onshow:"",onfocus:"<?php echo L('announcements_cannot_be_empty')?>"}).functionValidator({
	    fun:function(val,elem){
	    //获取编辑器中的内容
		var oEditor = CKEDITOR.instances.content;
		var data = oEditor.getData();
        if(data==''){
		    return "<?php echo L('announcements_cannot_be_empty')?>"
	    } else {
			return true;
		}
	}
	});
});
</script>